add group_photo_info for lensdata

Brightcells 8 years ago
parent
commit
1ee8b5e061
1 changed files with 7 additions and 2 deletions
  1. 7 2
      pay/models.py

+ 7 - 2
pay/models.py

@@ -101,8 +101,13 @@ class OrderInfo(CreateUpdateMixin):
101 101
         }
102 102
 
103 103
     @property
104
-    def lensdata(self):
104
+    def lensdata(self, user_id=None):
105
+        try:
106
+            group_photo = GroupPhotoInfo.objects.get(pk=self.photo_id)
107
+        except GroupPhotoInfo.DoesNotExist:
108
+            group_photo = {}
105 109
         return {
106 110
             'session_id': self.session_id,
107
-            'photo_id': self.lensman_photo_id
111
+            'photo_id': self.lensman_photo_id,
112
+            'group_photo_info': group_photo and group_photo.photo_info(user_id),
108 113
         }